package chapter19;

public enum RoShamBo3 implements Competitor<RoShamBo3> {
    /**
     * note
     */
    PAPER {
        @Override
        public Outcome compete(RoShamBo3 competitor) {
            switch (competitor) {
                case ROCK:
                    return Outcome.WIN;
                case SCISSORS:
                    return Outcome.LOSE;
                case PAPER:
                default:
                    return Outcome.DRAW;
            }
        }
    },
    SCISSORS {
        @Override
        public Outcome compete(RoShamBo3 competitor) {
            switch (competitor) {
                case ROCK:
                    return Outcome.LOSE;
                case SCISSORS:
                    return Outcome.DRAW;
                case PAPER:
                    return Outcome.WIN;
                default:
                    return Outcome.DRAW;
            }
        }
    },
    ROCK {
        @Override
        public Outcome compete(RoShamBo3 competitor) {
            switch (competitor) {
                case ROCK:
                    return Outcome.DRAW;
                case SCISSORS:
                    return Outcome.WIN;
                case PAPER:
                    return Outcome.LOSE;
                default:
                    return Outcome.DRAW;
            }
        }
    };

    public static void main(String[] args) {
        RoShamBo.play(RoShamBo3.class, 20);
    }
}
